<?php

use yii\db\Schema;
use yii\db\Migration;

class m160314_111227_update_creative_template extends Migration
{
    public function up()
    {
        $sql = <<<FINE
    TRUNCATE TABLE {{%creative_template}};	
    insert into {{%creative_template}} (name, code) values ('系统模板', '<div class="am_ad_container" style="position: relative; display: inline-block; border: none; padding: 0px; margin: 0px; visibility: visible; overflow: hidden;"><img src="{!dsp_show_url}" style="display:none;" /><script type="text/javascript" charset="utf-8">am_id = "{!dsp_creative_id}";am_tp = "{!dsp_creative_type}";am_wt = "{!dsp_creative_width}";am_ht = "{!dsp_creative_height}";am_ml = "{!dsp_creative_material}";am_ck = "{!vam_click_url}{!dsp_click_url}{!dsp_creative_monitor}{!dsp_creative_landingpage}";am_impr = "{!dsp_creative_impr}";am_logo = "{!dsp_creative_logo}"; </script><script type="text/javascript" charset="utf-8" class="ads_power_by_admath" id="am_{!dsp_creative_id}{!dsp_creative_width}{!dsp_creative_height}" src="{!dsp_cdn_url}/am_d.js"></script></div>');
    insert into {{%creative_template}} (name, code) values ('晃动动画模板', '<div class="am_ad_container" style="position: relative; display: inline-block; border: none; padding: 0px; margin: 0px; visibility: visible; overflow: hidden;"><img src="{!dsp_show_url}" style="display:none;" /><script type="text/javascript" charset="utf-8">am_id = "{!dsp_creative_id}";am_tp = "{!dsp_creative_type}";am_wt = "{!dsp_creative_width}";am_ht = "{!dsp_creative_height}";am_ml = "{!dsp_creative_material}";am_ck = "{!vam_click_url}{!dsp_click_url}{!dsp_creative_monitor}{!dsp_creative_landingpage}";am_impr = "{!dsp_creative_impr}";am_logo = "{!dsp_creative_logo}";am_an = "1"; </script><script type="text/javascript" charset="utf-8" class="ads_power_by_admath" id="am_{!dsp_creative_id}{!dsp_creative_width}{!dsp_creative_height}" src="{!dsp_cdn_url}/am_d.js"></script></div>');
FINE;
        return $this->execute($sql);
    }

    public function down()
    {
        return true;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
